package com.example.practice2023.service;

import com.example.practice2023.dbo.MemberAddGroup;
import com.example.practice2023.dbo.MemberGoup;
import com.example.practice2023.dbo.StatusGroup;
import com.example.practice2023.mapper.ChartMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ChartService {
    @Resource
    private ChartMapper chartMapper;
//    店铺营业状态
    public Map<String,Object> ShopStatusGroup() {
        Map<String, Object> map = new HashMap<>();
        List<StatusGroup> statusGroup = chartMapper.ShopStatusGroup();
        map.put("code", 200);
        map.put("msg", "营业状态统计成功");
        map.put("data", statusGroup);
        return map;
    }
//会员等级
    public Map<String,Object> MemberGroup() {
        Map<String, Object> map = new HashMap<>();
        List<MemberGoup> MemberGoup = chartMapper.MemberGroup();
        map.put("code", 200);
        map.put("msg", "会员等级统计成功");
        map.put("data", MemberGoup);
        return map;
    }
//    日增会员
public Map<String,Object> MemberAddGroup() {
    Map<String, Object> map = new HashMap<>();
    List<MemberAddGroup> MemberAddGroup = chartMapper.MemberAddGroup();
    map.put("code", 200);
    map.put("msg", "新增会员统计成功");
    map.put("data", MemberAddGroup);
    return map;
}
}
